#!/usr/bin/python
import redis
import json
import types
import time

rClient = redis.Redis(
    host = "localhost",
    port = 6379,
    db = 0
)

ret = rClient.keys("moretv_p2p_group_general_*")
ret = rClient.hgetall("moretv_p2p_group_general_1000000")
for r in ret :
    value = json.loads(ret[r])
    for p in json.loads(value["peersStat"]) :
        print json.loads(value["peersStat"])[p]
print type(ret)
print time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
ret = rClient.get("moretv_p2p_group_attr_1000205000022")
print ret
